﻿#include "widget.h"
#include <QGraphicsScene>
#include <QGraphicsItem>
#include <QGraphicsView>
#include <QApplication>
#include <QScreen>
#include <QDebug>
#include <QApplication>
#include <QDir>
#include "../../CatTools/TeachingTools/CatMath.h"
//#include "../../CatTools/ImageTools/gif.h"
#include "../../CatTools/ImageTools/GifButtonWidget.h"
#include "../../CatTools/ImageTools/CatGifTool.h"


int main(int argc, char *argv[])
{

    QApplication a(argc, argv);

    QDir::setCurrent(QCoreApplication::applicationDirPath());
    qDebug() << "CatMath::CmtoPx :" << CatMath::CmtoPx(1010);
    qDebug() << "CatMath::PxtoCm :" << CatMath::PxtoCm(160);
    qDebug() << "CatMath::CosToAngle :" << CatMath::CosToAngle(850, CatMath::PythagoreanTheorem(850, 425));
    qDebug() << "CatMath::TanToAngle :" << CatMath::TanToAngle(425, 850);
    qDebug() << "CatMath::SinToAngle :" << CatMath::SinToAngle(425, CatMath::PythagoreanTheorem(850, 425));
    qDebug() << "CatMath::PythagoreanTheorem :" << CatMath::PythagoreanTheorem(425, 850);
    qDebug() << "dpi:" << QApplication::primaryScreen()->logicalDotsPerInch();
    CatGifTool gif;
    //gif.SetGeometry(200, 200, 400, 400);
    gif.show();
    /*GifButtonWidget gif;
    gif.show();*/
    /*Widget w;
    w.show();*/
    //std::vector<uint8_t> black(width * height * 4, 0);
/*
    int width = 1280;
    int height = 800;
    std::vector<uint8_t> black(width * height * 4, 0);
    std::vector<uint8_t> white(width * height * 4, 255);

    auto fileName = "bwgif.gif";
    int delay = 100;
    GifWriter g;
    GifBegin(&g, fileName, width, height, delay);
    GifWriteFrame(&g, black.data(), width, height, delay);
    GifWriteFrame(&g, white.data(), width, height, delay);
    GifEnd(&g);
*/
    return a.exec();
}
